#include <e32base.h>
#include <e32cons.h>
#include "SmsServiceEnginer.h"

#include "FileUtil.h"

LOCAL_C void InitCallL();
GLDEF_C TInt E32Main()
{
    __UHEAP_MARK;
    CTrapCleanup* cleanup = CTrapCleanup::New(); // get clean-up stack
    TRAPD(error,InitCallL()); // more initialization, then do example
    __ASSERT_ALWAYS(!error,User::Panic(_L("error!!"),error));
    delete cleanup; // destroy clean-up stack
    __UHEAP_MARKEND;
    return 0;
}

LOCAL_C void InitCallL()

{
    CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    CleanupStack::PushL(scheduler);
    CActiveScheduler::Install(scheduler);
    
    CSmsServiceEnginer *aEnginer = CSmsServiceEnginer::GetInstance();
    CFileUtil::LogToFileL("InitCallL>>>>>>>>>>>>>>>>>>>\r\n");
    aEnginer->Start();
    CFileUtil::LogToFileL("aEnginer->Start()>>>>>>>>>>>>\r\n");
    CActiveScheduler::Start();
    CleanupStack::PopAndDestroy(scheduler);

}

